//
//  ShowsDetailViewController.m
//  MeiLiProductModel
//
//  Created by B505 on 15/2/24.
//  Copyright (c) 2015年 孙晓林. All rights reserved.
//

#import "ShowsDetailViewController.h"
#import "PublicMethod.h"
#import "T4Marco.h"
#import "UIButton+Utils.h"
#import "UILabel+Utils.h"

#define kScrollViewContentHeight 667
#define kDistance 60
#define kScaleViewWidth 300
#define kCancelBtnWidth 15
#define kcancelBtnX 13
@interface ShowsDetailViewController ()

@property (weak, nonatomic) IBOutlet UIScrollView *showsDetailScrollView;
@property (strong, nonatomic) UIButton *cancelBtn;
@property (weak, nonatomic) IBOutlet UILabel *contentLabel;
@property (weak, nonatomic) IBOutlet UIImageView *scaleImageView;

@end

@implementation ShowsDetailViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    _showsDetailScrollView.bounces = YES;
    _showsDetailScrollView.showsHorizontalScrollIndicator = NO;
    _showsDetailScrollView.showsVerticalScrollIndicator = NO;
    _showsDetailScrollView.alwaysBounceVertical = YES;
    
    _cancelBtn = [UIButton buttonWithType:UIButtonTypeCustom];
    _cancelBtn.frame = CGRectMake(SCREEN_WIDTH - kCancelBtnWidth - kcancelBtnX, kcancelBtnX, kCancelBtnWidth, kCancelBtnWidth);
    [_cancelBtn setImageWithName:@"home_x"];
    [_cancelBtn addTarget:self action:@selector(onClickCancel:)];
    [_showsDetailScrollView addSubview:_cancelBtn];
    
    _contentLabel.numberOfLines = 0;
    _contentLabel.textColor = [UIColor whiteColor];
    _contentLabel.textAlignment = NSTextAlignmentLeft;
    _contentLabel.font = [UIFont systemFontOfSize:13];
    _contentLabel.attributedText = [PublicMethod adjustLabel_LineSpacingWithString:@"新美术馆于2008年3月竣工，位于中央美院校园内，是中国最具现代化标准的美术展览馆之一。美术馆建筑呈微微扭转的三维曲面体，天然岩板幕墙，配以最现代性的类雕塑建筑，展现中央美术学院内敛低调的特质，同时也与校园内吴良镛先生设计的深灰色彩院落式布局建筑物充分融合及协调。美术馆总面积为14777平方米，地上四层，\n    地下二层,局部地下一层，展览及成列面积\n\n共4250平方米,新美术馆于2008年3月竣工，位于中央美院校园内，是中国最具现代化标准的美术展览馆之一。美术馆建筑呈微微扭转的三维曲面体，天然岩板幕墙，配以最现代性的类雕塑建筑，展现中央美术学院内敛低调的特质，同时也与校园内吴良镛先生设计的深灰色彩院落式布局建筑物充分融合及协调。美术馆总面积为14777平方米，地上四层然岩板幕墙，配以最现代性的类雕塑建筑，展现中央美术学院内敛低调的特质，同时也与校园内吴良镛先生设计的深灰色彩院落式布局建筑物充分融合及协调。美术馆总面积为14777平方米，地上四层,咖啡厅、书店." ForLineSpacing:3];
    _contentLabel.backgroundColor = [UIColor clearColor];
    
    _scaleImageView.image = [PublicMethod cutImage:[UIImage imageNamed:@"pic_detail.jpg"] WithImageViewWidth:kScaleViewWidth WithImageViewHeight:kScaleViewWidth * 2 /3];
    
}

- (void)viewDidAppear:(BOOL)animated
{
    [super viewDidAppear:animated];
    
    _showsDetailScrollView.contentSize = CGSizeMake(SCREEN_WIDTH, kScrollViewContentHeight);
    
}

- (void)onClickCancel:(UIButton *)btn
{
    T4_LOG_FUNC();
    [self dismissViewControllerAnimated:YES completion:nil];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}



@end
